CREATE EXTERNAL TABLE jms_dm.dm_tab_scan_piece_day_summary_dt
(
    scan_type_code    string comment '扫描类型code 1：发件 2：到件 3：拆包',
    network_code      string comment '网点code',
    supplier_id     string comment '供应商id',
    supplier_code     string comment '供应商编码',
    supplier_name     string comment '供应商名',
    scan_type         string comment '扫描类型',
    network_name      string comment '网点名',
    network_type      tinyint comment '网点类型:1-总部,2-代理区,3-加盟商,4-中心,5-集散点,6-网点',
    pre_site_code     string comment '上一站code',
    pre_site_name     string comment '上一站',
    next_site_code    string comment '下一站code',
    next_site_name    string comment '下一站',
    shipment_no       string comment '任务号',
    shipment_name     string comment '任务名称',
    parts_cnt         bigint comment '散件件数',
    packages_cnt      bigint comment '包件数',
    in_packages_cnt   bigint comment '包内件数',
    scan_cnt          bigint comment '扫描件数',
    weight            decimal(10, 2) comment '重量',
    table_type tinyint COMMENT '任务类型；1,干线；2,支线',
    bz_type tinyint COMMENT '类型；1,出港；2,进港',
    one_id string COMMENT '排序唯一键',
    date_time         date comment 'sr分区'
) COMMENT '智能设备计件天粒度统计' PARTITIONED BY (
    `dt` string)
    STORED AS PARQUET
    LOCATION '/dw/hive/jms_dm.db/external/dm_tab_scan_piece_day_summary_dt'
    TBLPROPERTIES (
        'discover.partitions' = 'false',
        'parquet.column.index.access' = 'true'
        );